import { useState } from 'react';

import { FlowContextType, IFlowContext } from '@/context/flow-context';

import { FlowContext } from '../../context';

export function FlowProvider({ children }: { children: React.ReactNode }) {
  const [flowContext, setFlowContext] = useState<IFlowContext>({ id: 0, name: '' });

  const contextValue: FlowContextType = {
    id: flowContext.id,
    name: flowContext.name,
    setFlow: setFlowContext,
  };
  return <FlowContext.Provider value={contextValue}>{children}</FlowContext.Provider>;
}
